1   /************************************************************
2   *                     Copyright                            *
3   * Portions of this software are Copyright (c) 1993 - 2002, *
4   * Chad Z. Hower (Kudzu) and the Indy Pit Crew              *
5   *  - http://www.nevrona.com/Indy/                          *
6   ************************************************************/
7   package org.indy;
8   
9   import java.io.PrintStream;
10  import java.io.PrintWriter;
11  
12  
13  /***
14   *  IdException
15   *
16   *@author    owen
17   */
18  public class IndyException extends Exception {
19    private Exception m_wrappedException = null;
20  
21    /***
22     *  Description of the Field
23     */
24    protected String _msg = null;
25  
26    /***
27     *  Constructor for the IdException object
28     *
29     *@param  e  Description of the Parameter
30     */
31    public IndyException(Exception e) {
32      super();
33      m_wrappedException = e;
34    }
35  
36    /***
37     *  Constructor for the IdException object
38     *
39     *@param  e    Description of the Parameter
40     *@param  msg  Description of the Parameter
41     */
42    public IndyException(Exception e, String msg) {
43      this(e);
44      _msg = msg;
45    }
46  
47    /***
48     *  Constructor for the IdException object
49     *
50     *@param  msg  Description of the Parameter
51     */
52    public IndyException(String msg) {
53      this();
54      _msg = msg;
55    }
56  
57    /***
58     *  Constructor for the IdException object
59     */
60    public IndyException() {
61      super();
62    }
63  
64    /***
65     *  Gets the message attribute of the IdException object
66     *
67     *@return    The message value
68     */
69    public String getMessage() {
70      if (_msg == null) {
71        if (m_wrappedException != null) {
72          return m_wrappedException.getMessage();
73        }
74        else {
75          return null;
76        }
77      }
78      else {
79        return _msg;
80      }
81    }
82  
83    /***
84     *  Description of the Method
85     *
86     *@param  s  Description of the Parameter
87     */
88    public void printStackTrace(PrintWriter s) {
89      super.printStackTrace(s);
90  
91      if (m_wrappedException != null) {
92        s.println("Nested Exeception is: ");
93        m_wrappedException.printStackTrace(s);
94      }
95    }
96  
97    /***
98     *  Description of the Method
99     *
100    *@param  s  Description of the Parameter
101    */
102   public void printStackTrace(PrintStream s) {
103     super.printStackTrace(s);
104 
105     if (m_wrappedException != null) {
106       s.println("Nested Exeception is: ");
107       m_wrappedException.printStackTrace(s);
108     }
109   }
110 
111   /***
112    *  Description of the Method
113    */
114   public void printStackTrace() {
115     printStackTrace(System.err);
116   }
117 }
This page was automatically generated by Maven